package server;

import java.util.Vector;

/**
 * This class represents an image that has been uploaded to the server, either by a client or by an employee
 * @author yariv zur
 */
public class Representation {

	private String id, path, filePath, createdByJob;
	private Vector<Job> jobs;
	private boolean ready;
	/**
	 * Constructor for Representation class
	 * @param name - the Representation id
	 */
	public Representation(String name){
		this.id = name;
		jobs = new Vector<Job>(0);
		this.ready = false;
	}
	/**
	 * Getter for rep Id
	 * @return Rep. Id
	 */
	public String getId(){
		return this.id;
	}
	/**
	 * Getter for rep Jobs
	 * @return Jobs Vector of this representation
	 */
	public Vector<Job> getJobs(){
		return this.jobs;
	}
	/**
	 * Setter for rep server path
	 */
	public void setPath(String path){
		this.path = path;
	}
	/**
	 * Getter for rep path
	 * @return the URI of this representation (e.g. photos/[resource id]?rep=[representation id]
	 */
	public String getPath(){
		return this.path;
	}
	/**
	 * Setter for rep server file path
	 */
	public void setFilePath(String uri){
		filePath = uri;
	}
	/**
	 * Getter for rep file path - the path to the image file
	 * @return Rep. file path
	 */
	public String getFilePath(){
		return this.filePath;
	}
	/**
	 * Setter for rep state
	 */
	public void setReady(){
		this.ready = true;
	}
	/**
	 * Getter for rep state
	 * @return true if the representation is ready (image uploaded), false otherwise
	 */
	public boolean isReady(){
		return this.ready;
	}
	/**
	 * Setter for rep creation job
	 */
	public void setCreatedByJob(String jobId){
		this.createdByJob = jobId;
	}
	/**
	 * Getter for the Id of the Job that created this Rep.
	 * @return Job Id
	 */
	public String getCreatedByJob(){
		return this.createdByJob;
	}
}
